import  os
def print_tree_v2(directory, prefix='', specific_folder=None, in_specific_folder=False):
    """
    Prints the directory structure in a tree-like format, similar to the Linux 'tree' command.
    Modified to display files only in directories with a specific name, while still showing
    the entire directory structure.

    :param directory: The root directory to start from.
    :param prefix: The prefix used for the current level of the tree.
    :param specific_folder: The name of a specific folder to recognize. If specified, only files in folders
                            with this name will be listed.
    :param in_specific_folder: Flag to indicate whether the current directory is the specific folder.
    """
    files = []
    directories = []
    for item in os.listdir(directory):
        if os.path.isdir(os.path.join(directory, item)):
            directories.append(item)
        elif in_specific_folder:
            files.append(item)

    # Print the directories
    for index, name in enumerate(directories):
        path = os.path.join(directory, name)
        new_in_specific_folder = in_specific_folder or (specific_folder and name == specific_folder)

        if index == len(directories) - 1 and not files:
            print(f"{prefix}└── {name}")
            new_prefix = prefix + "    "
        else:
            print(f"{prefix}├── {name}")
            new_prefix = prefix + "│   "

        print_tree_v2(path, new_prefix, specific_folder, new_in_specific_folder)

    # Print the files
    for index, name in enumerate(files):
        if index == len(files) - 1:
            print(f"{prefix}└── {name}")
        else:
            print(f"{prefix}├── {name}")


# Example usage

# Example usage
print_tree_v2('/Users/yaodong/PycharmProjects/star_findp', specific_folder='bicep') # 'test' is an example folder name, you can change it as needed

